package org.wisigoth.chat.client;


import java.util.ArrayList;
import java.util.Collection;

import javax.swing.ImageIcon;
/**
 * The Default presence states basically provide by the Wisigoth client.
 * @author tof
 *
 */
public enum DefaultPresence implements Presence {

/**
 * The DefaultPresence is represented by an enumeration of 4 states : <BR>
 * - Available <BR>
 * - Away <BR>
 * - Do not disturb <BR>
 * - Offline
 */
	AVAILABLE("Available"), AWAY("Away"), DND("Do Not Disturb"), OFFLINE(
			"Offline");

	private String presenceName;


	private DefaultPresence(String name) {
		this.presenceName = name;
	}
	/**
	 * Return the name of a DefaultPresence
	 * @param presenceName
	 */
	public String getPresenceName() {
		return this.presenceName;
	}
/**
 * Return the picture associated to a DefaultPresence.
 * @return {@link ImageIcon}
 */
	public ImageIcon getPresenceImage() {
		return new ImageIcon("resources/images/status/"
				+ this.getPresenceName() + "2.png");
	}

/**
 * Return the Collection of the Defaults Presences :
 * {Available, Away, Do Not Disturb}	
 * @return {@link Collection}{@link Presence}
 */
	public static Collection<Presence> getDefaults() {
 
		Collection<Presence> result = new ArrayList<Presence>(values().length);
		for (Presence presence : values()) {
			result.add(presence);
		}
		return result;
	}

}
